package com.anjubao.parking.municipal.roadside.constant;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author anjubao
 */
@Getter
@AllArgsConstructor
public enum DeviceStatusEnum {

    //状态: 0,禁用; -1,故障; 1,正常
    Forbiddance(0, "禁用"),
    Breakdown(-1, "故障"),
    Normal(1, "正常");

    private int code;

    private String desc;

    public static DeviceStatusEnum getByCode(int code) {
        for (DeviceStatusEnum typeEnum : values()) {
            if (typeEnum.getCode() == code) {
                return typeEnum;
            }
        }
        return null;
    }

}



